package com.eorchis.module.news.ui.commond;

import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.apache.commons.beanutils.BeanUtils;
import org.codehaus.jackson.map.ObjectMapper;

import com.eorchis.core.page.commond.SortInfoBean;
import com.eorchis.core.ui.commond.IQueryCommond;
import com.eorchis.core.ui.commond.impl.BasePageQueryCommond;

/**
 * Title: NewsCommond<br>
 * Description: 消息管理Commond<br>
 * Company: GoldGov<br>
 * Copyright @ 2012 GoldGov .All rights reserved.<br>
 * @author RongSL
 * @createDate 2016-05-06
 * @version $Revision$
 */
public class NewsQueryCommond extends BasePageQueryCommond implements IQueryCommond {

	private String[] searchNewsIds;	

	/**
	 * 查询条件：发送人显示状态
	 */
	private Integer searchSendLookState;			
	/**
	 * 查询条件：消息内容
	 */
	private String searchNewsValue;				
	/**
	 * 查询条件：类型ID
	 */
	private String  searchNewsId;//消息ID
	private Integer searchReadState;//读取状态
	private Integer searchErplyState;//回复状态
	private String searchNewsTitle;//标题
	private String searchUserId;//用户ID
	private String searchTypeId;				
	private String searchLoginId;//登陆号
	private String searchUserName;//用户名
	private String searchDepName;//单位名称
	private String searchRoleCode;//角色编码
	private String[] searchSelectedUserIds;//已选人员ids
	private String[] searchClassIds;//培训班ID
	private Integer searchSelectState;//选中状态
	private String searchNewsCode;//消息类型
	private String searchReceiveUser;//接收人
	private String searchBeginDate;//发送时间(开始)
	private String searchEndDate;//发送时间(结束)
	private String searchNewsUserLink;
	private String roleCode;//角色编码

	private String deptID;//单位ID
	
	public String getSearchNewsUserLink() {
		return searchNewsUserLink;
	}
	public void setSearchNewsUserLink(String searchNewsUserLink) {
		this.searchNewsUserLink = searchNewsUserLink;
	}
	public String getSearchNewsId() {
		return searchNewsId;
	}
	public void setSearchNewsId(String searchNewsId) {
		this.searchNewsId = searchNewsId;
	}
	public Integer getSearchReadState() {
		return searchReadState;
	}
	public void setSearchReadState(Integer searchReadState) {
		this.searchReadState = searchReadState;
	}
	public Integer getSearchErplyState() {
		return searchErplyState;
	}
	public void setSearchErplyState(Integer searchErplyState) {
		this.searchErplyState = searchErplyState;
	}
	public String getSearchNewsTitle() {
		return searchNewsTitle;
	}
	public void setSearchNewsTitle(String searchNewsTitle) {
		this.searchNewsTitle = searchNewsTitle;
	}
	public String getSearchUserId() {
		return searchUserId;
	}
	public void setSearchUserId(String searchUserId) {
		this.searchUserId = searchUserId;
	}
	public String[] getSearchNewsIds() {
		return searchNewsIds;
	}
	public void setSearchNewsIds(String[] searchNewsIds) {
		this.searchNewsIds = searchNewsIds;
	}
	public Integer getSearchSendLookState() {
		return searchSendLookState;
	}
	public void setSearchSendLookState(Integer searchSendLookState) {
		this.searchSendLookState = searchSendLookState;
	}

	public String getSearchNewsValue() {
		return searchNewsValue;
	}
	public void setSearchNewsValue(String searchNewsValue) {
		this.searchNewsValue = searchNewsValue;
	}

	public String getSearchTypeId() {
		return searchTypeId;
	}
	public void setSearchTypeId(String searchTypeId) {
		this.searchTypeId = searchTypeId;
	}
	/**
	 * EXT 页面排序
	 */
	private SortInfoBean sortInfo = null;
	
	/**
	 * 获取排序内容
	 * 
	 * @return
	 * @author HuangS
	 * @date Jul 20, 2012
	 */
	public SortInfoBean getSortInfos() {
		return this.sortInfo;
	}
	/**
	 * 设置排序内容
	 * 
	 * @param sort
	 * @author HuangS
	 * @date Jul 25, 2012
	 */
	@SuppressWarnings("unchecked")
	public void setSort(String sort) {
		if (sort != null && !"".equals(sort)) {
			sortInfo = new SortInfoBean();
			ObjectMapper objectMapper = new ObjectMapper();
			try {
				List<LinkedHashMap<String, Object>> list = objectMapper.readValue(sort, List.class);
				for (int i = 0; i < list.size(); i++) {
					Map<String, Object> map = list.get(i);
					Set<String> set = map.keySet();
					for (Iterator<String> it = set.iterator(); it.hasNext();) {
						String key = it.next();
						BeanUtils.setProperty(sortInfo, key, map.get(key));
					}
				}
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}
	public String getSearchLoginId() {
		return searchLoginId;
	}
	public void setSearchLoginId(String searchLoginId) {
		this.searchLoginId = searchLoginId;
	}
	public String getSearchUserName() {
		return searchUserName;
	}
	public void setSearchUserName(String searchUserName) {
		this.searchUserName = searchUserName;
	}
	public String getSearchDepName() {
		return searchDepName;
	}
	public void setSearchDepName(String searchDepName) {
		this.searchDepName = searchDepName;
	}
	public String getSearchRoleCode() {
		return searchRoleCode;
	}
	public void setSearchRoleCode(String searchRoleCode) {
		this.searchRoleCode = searchRoleCode;
	}
	public String[] getSearchSelectedUserIds() {
		return searchSelectedUserIds;
	}
	public void setSearchSelectedUserIds(String[] searchSelectedUserIds) {
		this.searchSelectedUserIds = searchSelectedUserIds;
	}
	public String[] getSearchClassIds() {
		return searchClassIds;
	}
	public void setSearchClassIds(String[] searchClassIds) {
		this.searchClassIds = searchClassIds;
	}
	public Integer getSearchSelectState() {
		return searchSelectState;
	}
	public void setSearchSelectState(Integer searchSelectState) {
		this.searchSelectState = searchSelectState;
	}
	public String getSearchNewsCode() {
		return searchNewsCode;
	}
	public void setSearchNewsCode(String searchNewsCode) {
		this.searchNewsCode = searchNewsCode;
	}
	public String getSearchReceiveUser() {
		return searchReceiveUser;
	}
	public void setSearchReceiveUser(String searchReceiveUser) {
		this.searchReceiveUser = searchReceiveUser;
	}
	public String getSearchBeginDate() {
		return searchBeginDate;
	}
	public void setSearchBeginDate(String searchBeginDate) {
		this.searchBeginDate = searchBeginDate;
	}
	public String getSearchEndDate() {
		return searchEndDate;
	}
	public void setSearchEndDate(String searchEndDate) {
		this.searchEndDate = searchEndDate;
	}
	public String getRoleCode() {
		return roleCode;
	}
	public void setRoleCode(String roleCode) {
		this.roleCode = roleCode;
	}
	public String getDeptID() {
		return deptID;
	}
	public void setDeptID(String deptID) {
		this.deptID = deptID;
	}
	
	
	
	
}
